package com.kanshu.ksgb.fastread.doudou.module.personal.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;

import com.kanshu.ksgb.fastread.doudou.R;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by xubo on 18/10/21
 */
public class NewUserDialog extends Dialog {

    public NewUserDialog(@NonNull Context context) {
        super(context, R.style.dialog_style);
        init();
    }

    public NewUserDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
        init();
    }

    protected NewUserDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
        init();
    }

    private void init() {
        setContentView(R.layout.dialog_new_user);
        ButterKnife.bind(this);

    }

    @OnClick({R.id.close, R.id.ivContent})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.close:
            case R.id.ivContent:
                dismiss();
                break;
        }
    }

    public static NewUserDialog show(Activity activity) {
        if (activity == null || activity.isFinishing()) {
            return null;
        }
        final NewUserDialog dlg = new NewUserDialog(activity);
        dlg.show();
        return dlg;
    }
}
